package listbyorder.access201_300.test217;

import java.util.HashSet;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/23 22:01
 */
public class Solution1 {

    public boolean containsDuplicate(int[] nums) {
        if (nums.length == 0) return false;
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if (set.contains(nums[i])) {
                return true;
            }
            set.add(nums[i]);
        }
        return false;
    }
}
